package com.qianyue.命令模式;

/**
 * 订单命令
 *
 * @author qian yue
 * @version v1.0.0
 * @since 2025/2/4 21:52
 */
public class OrderCommand implements Command {
    private final Order order;

    private final SeniorChef seniorChef;

    public OrderCommand(Order order, SeniorChef seniorChef) {
        this.order = order;
        this.seniorChef = seniorChef;
    }

    @Override
    public void execute() {
        System.out.println(order.getDiningTable() + "号桌：");
        for (String foodName : order.getFoodDic().keySet()) {
            seniorChef.MakeFood(foodName, order.getFoodDic().get(foodName));
        }
    }
}
